package org.dromara.project.controller;

import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import org.dromara.project.service.IProAddressService;
import org.dromara.project.domain.vo.ProAddressVo;
import org.dromara.common.core.domain.R;
import java.util.List;

/**
 * 地区选择
 */
@RequiredArgsConstructor
@RestController
@RequestMapping("/pro/address")
public class ProAddressController {

    private final IProAddressService proAddressService;

    /**
     * 根据父ID查询所有子地址
     */
    @GetMapping("/parent/{parentId}")
    public R<List<ProAddressVo>> listByParent(@PathVariable Long parentId) {
        return R.ok(proAddressService.selectByParentId(parentId));
    }
}
